package com.mall.coupon.server.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mall.coupon.server.mapper.PmsSpuInfoMapper;
import com.mall.coupon.server.service.PmsSpuInfoService;
import com.mall.coupon.common.domain.PmsSpuInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PmsSpuInfoServiceImpl implements PmsSpuInfoService {
    @Autowired
    private PmsSpuInfoMapper pmsSpuInfoMapper;


    @Override
    public PageInfo<PmsSpuInfo> selectPmsSpuInfoList(PmsSpuInfo pmsSpuInfo) {
        PageHelper.startPage(pmsSpuInfo.getPageNum(),pmsSpuInfo.getPageSize());
        List<PmsSpuInfo> pmsSpuInfos = pmsSpuInfoMapper.selectPmsSpuInfoList(pmsSpuInfo);
        PageInfo<PmsSpuInfo> info = new PageInfo<>(pmsSpuInfos);
        return info;
    }
}
